-
Notifications
You must be signed in to change notification settings - Fork 351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: use out.String() instead of string(out.Bytes()) #557
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: guoguangwu <[email protected]>
both are copy string, no difference... |
bytes.Buffer has both a String and a Bytes method. It is almost never necessary to use string(buf.Bytes()) or []byte(buf.String()) – simply use the other method. The only exception to this are map lookups. Due to a compiler optimization, m[string(buf.Bytes())] is more efficient than m[buf.String()]. |
AsterDY
approved these changes
Nov 17, 2023
kodiakhq bot
referenced
this pull request
in cloudquery/codegen
Mar 1, 2024
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/bytedance/sonic](https://togithub.com/bytedance/sonic) | indirect | minor | `v1.10.2` -> `v1.11.2` | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>bytedance/sonic (github.com/bytedance/sonic)</summary> ### [`v1.11.2`](https://togithub.com/bytedance/sonic/releases/tag/v1.11.2) [Compare Source](https://togithub.com/bytedance/sonic/compare/v1.11.1...v1.11.2) #### Bugfix - \[[#​603](https://togithub.com/bytedance/sonic/issues/603)] fix:(ast) SortKeys(true) panic when not loaded-all **Full Changelog**: bytedance/sonic@v1.11.1...v1.11.2 ### [`v1.11.1`](https://togithub.com/bytedance/sonic/releases/tag/v1.11.1) [Compare Source](https://togithub.com/bytedance/sonic/compare/v1.11.0...v1.11.1) #### Feature - \[[#​594](https://togithub.com/bytedance/sonic/issues/594)] (ast) add new node method "IndexOrGetWithIdx" #### Bugfix - \[[#​601](https://togithub.com/bytedance/sonic/issues/601)] (ast) `Unset()` used physical index to `removePair` - \[[#​599](https://togithub.com/bytedance/sonic/issues/599)] (build) support build `rt` on non-amd64 env #### New Contributors - [@​Bisstocuz](https://togithub.com/Bisstocuz) made their first contribution in [https://github.com/bytedance/sonic/pull/594](https://togithub.com/bytedance/sonic/pull/594) **Full Changelog**: bytedance/sonic@v1.11.0...v1.11.1 ### [`v1.11.0`](https://togithub.com/bytedance/sonic/releases/tag/v1.11.0) [Compare Source](https://togithub.com/bytedance/sonic/compare/v1.10.2...v1.11.0) #### Feature - \[[#​590](https://togithub.com/bytedance/sonic/issues/590)] **support go1.22** - \[[#​558](https://togithub.com/bytedance/sonic/issues/558)] (encoder) allow the disabling of the newline in the encoder - \[[#​577](https://togithub.com/bytedance/sonic/issues/577)] (ast) always copy once after top `Get` #### Bugfix - \[[#​540](https://togithub.com/bytedance/sonic/issues/540)] (encoder) checked if a interface is empty by its value field instead of type field - \[[#​544](https://togithub.com/bytedance/sonic/issues/544)] (ast) didn't pass non-exist value when call `Node.Interface()` - \[[#​547](https://togithub.com/bytedance/sonic/issues/547)] (decoder) didn't fully reuse buffer memory - \[[#​569](https://togithub.com/bytedance/sonic/issues/569)] (ast) `Set` on non-object node unexpectedly - \[[#​571](https://togithub.com/bytedance/sonic/issues/571)] (ast) implement soft delete for `Unset()`. - **Break change** : `Unset()`'s behavior will be compatible with versions <= 1.9.x, while being incompatible with versions on 1.10.x #### Optimization - \[[#​550](https://togithub.com/bytedance/sonic/issues/550)] (decoder) refactor streaming decoder to fully use buffer - \[[#​545](https://togithub.com/bytedance/sonic/issues/545)] eliminate race test errors - \[[#​552](https://togithub.com/bytedance/sonic/issues/552)] (loader) use lockfree to register new modules #### New Contributors - [@​felix021](https://togithub.com/felix021) made their first contribution in [https://github.com/bytedance/sonic/pull/552](https://togithub.com/bytedance/sonic/pull/552) - [@​testwill](https://togithub.com/testwill) made their first contribution in [https://github.com/bytedance/sonic/pull/557](https://togithub.com/bytedance/sonic/pull/557) - [@​elee1766](https://togithub.com/elee1766) made their first contribution in [https://github.com/bytedance/sonic/pull/558](https://togithub.com/bytedance/sonic/pull/558) **Full Changelog**: bytedance/sonic@v1.10.2...v1.11.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on the first day of the month" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yMjEuMCIsInVwZGF0ZWRJblZlciI6IjM3LjIyMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
kodiakhq bot
referenced
this pull request
in cloudquery/filetypes
Mar 1, 2024
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/bytedance/sonic](https://togithub.com/bytedance/sonic) | indirect | minor | `v1.10.2` -> `v1.11.2` | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>bytedance/sonic (github.com/bytedance/sonic)</summary> ### [`v1.11.2`](https://togithub.com/bytedance/sonic/releases/tag/v1.11.2) [Compare Source](https://togithub.com/bytedance/sonic/compare/v1.11.1...v1.11.2) #### Bugfix - \[[#​603](https://togithub.com/bytedance/sonic/issues/603)] fix:(ast) SortKeys(true) panic when not loaded-all **Full Changelog**: bytedance/sonic@v1.11.1...v1.11.2 ### [`v1.11.1`](https://togithub.com/bytedance/sonic/releases/tag/v1.11.1) [Compare Source](https://togithub.com/bytedance/sonic/compare/v1.11.0...v1.11.1) #### Feature - \[[#​594](https://togithub.com/bytedance/sonic/issues/594)] (ast) add new node method "IndexOrGetWithIdx" #### Bugfix - \[[#​601](https://togithub.com/bytedance/sonic/issues/601)] (ast) `Unset()` used physical index to `removePair` - \[[#​599](https://togithub.com/bytedance/sonic/issues/599)] (build) support build `rt` on non-amd64 env #### New Contributors - [@​Bisstocuz](https://togithub.com/Bisstocuz) made their first contribution in [https://github.com/bytedance/sonic/pull/594](https://togithub.com/bytedance/sonic/pull/594) **Full Changelog**: bytedance/sonic@v1.11.0...v1.11.1 ### [`v1.11.0`](https://togithub.com/bytedance/sonic/releases/tag/v1.11.0) [Compare Source](https://togithub.com/bytedance/sonic/compare/v1.10.2...v1.11.0) #### Feature - \[[#​590](https://togithub.com/bytedance/sonic/issues/590)] **support go1.22** - \[[#​558](https://togithub.com/bytedance/sonic/issues/558)] (encoder) allow the disabling of the newline in the encoder - \[[#​577](https://togithub.com/bytedance/sonic/issues/577)] (ast) always copy once after top `Get` #### Bugfix - \[[#​540](https://togithub.com/bytedance/sonic/issues/540)] (encoder) checked if a interface is empty by its value field instead of type field - \[[#​544](https://togithub.com/bytedance/sonic/issues/544)] (ast) didn't pass non-exist value when call `Node.Interface()` - \[[#​547](https://togithub.com/bytedance/sonic/issues/547)] (decoder) didn't fully reuse buffer memory - \[[#​569](https://togithub.com/bytedance/sonic/issues/569)] (ast) `Set` on non-object node unexpectedly - \[[#​571](https://togithub.com/bytedance/sonic/issues/571)] (ast) implement soft delete for `Unset()`. - **Break change** : `Unset()`'s behavior will be compatible with versions <= 1.9.x, while being incompatible with versions on 1.10.x #### Optimization - \[[#​550](https://togithub.com/bytedance/sonic/issues/550)] (decoder) refactor streaming decoder to fully use buffer - \[[#​545](https://togithub.com/bytedance/sonic/issues/545)] eliminate race test errors - \[[#​552](https://togithub.com/bytedance/sonic/issues/552)] (loader) use lockfree to register new modules #### New Contributors - [@​felix021](https://togithub.com/felix021) made their first contribution in [https://github.com/bytedance/sonic/pull/552](https://togithub.com/bytedance/sonic/pull/552) - [@​testwill](https://togithub.com/testwill) made their first contribution in [https://github.com/bytedance/sonic/pull/557](https://togithub.com/bytedance/sonic/pull/557) - [@​elee1766](https://togithub.com/elee1766) made their first contribution in [https://github.com/bytedance/sonic/pull/558](https://togithub.com/bytedance/sonic/pull/558) **Full Changelog**: bytedance/sonic@v1.10.2...v1.11.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on the first day of the month" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yMjEuMCIsInVwZGF0ZWRJblZlciI6IjM3LjIyMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.